package com.zhou.service.impl;

import com.zhou.service.WxEventStrategy;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * @author lcz
 * @desc 容器类，用来选择使用哪种策略
 * @mail lcz_0130@163.com
 * @date 2023/12/28
 */

@Service
public class WxEventContext {
    @Resource
    private Map<String, WxEventStrategy> strategyMap;

    public void execute(String strategy, Map<String, String> requestMap, HttpServletResponse response) throws Exception {
        strategyMap.get(strategy).execute(requestMap, response);
    }
}
